﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="edit_nedbilde.aspx.cs" Inherits="edit_nedbilde" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" 
            LogoutPageUrl="~/Default.aspx" />
        <asp:LoginName ID="LoginName1" runat="server" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="EditZinas.aspx">EditZinas.aspx</a><br />
        <asp:Label ID="Label1" runat="server" Text="Nedēļas bilde"></asp:Label>
        <br />
        <br />
        <asp:TextBox ID="TextBox1" runat="server" Height="50px" TextMode="MultiLine" 
            Width="300px"></asp:TextBox>
        <br />
        <br />
        <asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="300px" />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Save" />
        <br />
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource1" 
            EmptyDataText="There are no data records to display." ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" />
                <asp:BoundField DataField="info" HeaderText="info" SortExpression="info" />
                <asp:BoundField DataField="imgSmall" HeaderText="imgSmall" 
                    SortExpression="imgSmall" />
                <asp:BoundField DataField="imgBig" HeaderText="imgBig" 
                    SortExpression="imgBig" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MyDB %>" 
            DeleteCommand="DELETE FROM [nedBilde] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [nedBilde] ([info], [imgSmall], [imgBig]) VALUES (@info, @imgSmall, @imgBig)" 
            ProviderName="<%$ ConnectionStrings:MyDB.ProviderName %>" 
            SelectCommand="SELECT [ID], [info], [imgSmall], [imgBig] FROM [nedBilde]" 
            UpdateCommand="UPDATE [nedBilde] SET [info] = @info, [imgSmall] = @imgSmall, [imgBig] = @imgBig WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="info" Type="String" />
                <asp:Parameter Name="imgSmall" Type="String" />
                <asp:Parameter Name="imgBig" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="info" Type="String" />
                <asp:Parameter Name="imgSmall" Type="String" />
                <asp:Parameter Name="imgBig" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
    
    </div>
    </form>
</body>
</html>
